A novel hermit crab optimization algorithm

High-dimensional optimization has numerous potential applications in both academia and industry. It is a major challenge for optimization algorithms to generate very accurate solutions in high-dimensional search spaces. However, traditional search tools are prone to dimensional catastrophes and local optima, thus failing to provide high-precision results. To solve these problems, a novel hermit crab optimization algorithm (the HCOA) is introduced in this paper. Inspired by the group behaviour of hermit crabs, the HCOA combines the optimal search and historical path search to balance the depth and breadth searches. In the experimental section of the paper, the HCOA competes with 5 well-known metaheuristic algorithms in the CEC2017 benchmark functions, which contain 29 functions, with 23 of these ranking first. The state of work BPSO-CM is also chosen to compare with the HCOA, and the competition shows that the HCOA has a better performance in the 100-dimensional test of the CEC2017 benchmark functions. All the experimental results demonstrate that the HCOA presents highly accurate and robust results for high-dimensional optimization problems.

www.nature.com/scientificreports/ of an optimization problem. With the continuous development of blockchain technology [22][23][24][25] , big data 26,27 and practical nanotechnology [28][29][30] , the dimensionality of optimization problems is increasing dramatically. Li 31 proposed a dimension dynamic sine cosine algorithm (DDSCA). In the DDSCA, the solution of each dimension is obtained first, and then the greedy algorithm is used to combine the solution of other dimensions and form a new solution. Yang 32 introduced an elitist oriented particle swarm optimization algorithm (EDPSO), which uses historical information about particles to efficiently solve high-dimensional optimization problems. Chen 33 designed an Efficient hierarchical surrogate assisted differential evolution (EHSDE), which balances exploration and development in a high-dimensional optimized space using a hierarchical approach. On the one hand, the above algorithms cannot effectively balance between depth searches and breadth searches in high-dimensional spaces. On the other hand, these algorithms cannot jump to the local optimum in the initial stages of the search, or are unable to search for a preferable value after jumping out of the local optimum. So, it is also crucial to develop a new optimization algorithm to solve high-dimensional optimization problems as effectively as possible. This paper introduces a new optimization algorithm, which is named hermit crab optimization algorithm (HCOA), to solve high-dimensional optimization problems. It is inspired by the distinctive behaviour of hermit crabs in searching for, and changing to, appropriate houses to survive during their continuous growth. More specifically, the main research contributions of this paper are as follows: 1. Optimal search: The hermit crabs search in the vicinity of the alpha hermit crab of the entire population. In adherence to this rule, HCAO guarantees the accuracy of the search. 2. Historical path search: The hermit crabs search around the historical path of the population's alpha hermit crabs. With this strategy, the HCOA balances between breadth and depth searches in a high-dimensional space, and helps the HCOA to jump out of the local optimum.
The remaining sections of the manuscript are organized as follows. "Materials and methods" elaborates on the proposed algorithm in detail. "Results" shows the details and results of the simulation experiments. "Conclusions" concludes this work and presents future works.

Materials and methods
Behaviour of hermit crab. Hermit crabs are arthropods similar to shrimp and crabs that live mainly in coastal areas. They are also omnivorous and are known as the "scavengers" of the seashore, eating everything from algae and food scraps to parasites, and they play an essential role in the ecological balance. However, hermit crabs rely heavily on their houses for survival, and years of research have shown that proper houses help hermit crabs survive, feed and resist predators, and if hermit crabs lose their houses, the soft tissue structures of their abdomens become exposed and unprotected. Hermit crabs may die if they live in unsuitable houses or have no houses to live in for a long time. As they grow, hermit crabs are continuously searching and acquiring houses that are appropriate for their survival. Its population behaviour of searching for, and changing to, new houses is a unique natural process. The hermit crabs search for a proper house to survive in their surrounding location or host an aged house that other crabs have shed. If the hermit crab is unable to find a suitable new house, it must return to its original house.
Hermit crab optimization algorithm. Inspired by the constant house-searching and house-changing behaviour of hermit crabs, we idealize the characteristics of hermit crabs' behaviours. Relating the process of hermit crabs' house searching and house changing to the objective function to be optimized, we are able to design a hermit crab-inspired optimization algorithm (the HCOA). In hermit crab populations, there are many factors involved in selecting the right house, including size, species and colour. In the HCOA, for simplicity, we assume that each hermit crab has no mass or volume, and represents only a point in space, and each point is a solution to a certain problem. The fitness of each hermit crab for a new house is associated with the optimal value of the target function, and an adaptation degree analogy is associated with the house. Because of the large and variable distribution of crustaceans in coastal areas, we randomly generate a large number of houses in the HCOA. Based on the behaviour of the hermit crabs, we use two house-searching and house-changing rules, which are denoted as the optimal search and the historical path search. These two strategies can help the HCOA balance the breadth searches and width searches in a high-dimensional search space, and increase the possibility of jumping out of a local optimum. The search diagram for the HCOA is shown in Fig. 1. At the same time, the basic steps of the HCOA are summarized using the pseudocode displayed in algorithm 1, and the HCOA flowchart is displayed in Fig. 2. The two the HCOA search strategies create only linear transformations in the time complexity. Therefore, the time complexity of an the HCOA is still linear complexity O(n).  www.nature.com/scientificreports/ Optimal search. The alpha hermit crab of the crab population gains more valuable survival experience than the other hermit crabs, and it is more experienced in finding a new house. Therefore, other hermit crabs are more likely to find more appropriate houses in the vicinity of the population's alpha hermit crab. If other hermit crabs find a more appropriate house than the one it currently has, it changes houses. By comparison, if it does not find a more suitable house, it continues to use the original house in order to survive. In the HCOA, after each calculation of the function fitness, the fitness of all the hermit crabs is ranked. The hermit crab with the best fitness is selected for comparison with the alpha hermit crab. If a hermit crab with the best fitness is better, then it is more experienced in survival than the existing alpha hermit crab. The optimal search process is summarized in the pseudocode shown in Algorithm 2. With the guidance of this rule, the HCOA can accurately find the optimal solution.
In the (t)th generation, the alpha hermit crab finds the most appropriate house position Alpha t . Pbest t (γ ) means that each hermit crab in the population finds the (t)th most appropriate house's position, and Pcandidate t+1 (γ ) is the (t + 1) th candidate house's position. GD(α, δ) is a Gaussian distribution with mean α and standard deviation δ , which is used to simulate the distribution of the houses.
(1) www.nature.com/scientificreports/ Historical path search. The alpha hermit crab from the entire crab population is replaced when other hermit crabs have a more appropriate house than the alpha hermit crab. However, each generation of alpha hermit crabs in the population sheds its original house when it seeks a more appropriate house. The original house remains in place, while the alpha hermit crab replaces it with a more appropriate house. These original houses may be used by other hermit crabs. It is also possible that more appropriate houses exist around these houses for other hermit crabs to live in. The houses abandoned by alpha hermit crabs change with the environment and hermit crab behaviours. On the one hand, they may simply disappear; on the other hand, they may appear near their original location. Therefore, other hermit crabs want to find a more suitable house. In the HCOA, other hermit crabs search around the historical path of the five houses where the alpha hermit crab has recently left, because there may be a better chance of finding a house that suits them. A historical path means that the HCOA has deeper search spaces. A hermit crab may find a better house nearby on the five historical paths and attain a house replacement. This search process increases the HCOA width search in high-dimensional space. If a more suitable shell is not found, the hermit crab returns to its original shell. The historical path search process can be summarized in the pseudocode shown in Algorithm 3.
In the (t)th generation, the best personal position for each hermit crab is Pbest t (γ ) . By the definition of the HCOA, ω = (1, 5) is the alpha hermit crab in most recent history to shed the first few houses, and the population's current alpha hermit crabs keep the houses it recently replaced. We use Ghistory t (ω) to record the population's alpha hermit crabs houses' historical position. Candiate_pbest t+1 (γ , ω) means hermit crabs search around the ω houses' positions. GD(β, ) is a Gaussian distribution with mean β and standard , which is used to simulate the distribution of houses. F is the indicator test function. Experimental results. To better analyse the experimental results, GT is used to measure the performance of each algorithm. In this work, GT is defined as Gobaloptimum − theoreticaloptimum . Specific numerical results, including the mean value (MV) and standard deviation (Std) of 37 independent runs, are displayed in Tables 1 and 2. The Friedman statistic test is used to analyse the results. The rank results (RRs) are also shown in Tables 1 and 2. The average rank point of the HCOA is 1.4828, which is 56.121% better than the second ranked algorithm BBPSO. the HCOA provides a solution to high-dimensional optimization problems. The average ranks are shown at the bottom of Table 2. The results of the first ranking of the HCOA out of 29 benchmarking functions in CEC2017 are in Table 3, and the remaining ranking results are in Table 4.
After comparing and counting, HCAO ranks first in the number of functions among the 29 benchmarked functions in CEC2017 with 23, ranked second, third, and fifth with two each, and none ranked fourth and sixth. And the ranking shows that HCAO has a better performance at simple multipeak function (f3-f9), hybrid function (f10-f19), and composition function than other algorithms.
The OE results are shown in Table 5. The results indicate that the HCOA has the best performance. www.nature.com/scientificreports/ It can be seen from Tables 5 and 6 that the HCOA performs better than BPSO-CM in 20 functions. Meanwhile, the OE of the HCOA reaches 68.97%, which is 37.94% higher than the 31.03% of BPSO-CM. The experimental results show that the HCOA can provide a high precision solution for single objective high-dimensional optimization problems.

Conclusions
A novel hermit crab optimization algorithm (the HCOA) that produces high-precision results for high-dimensional optimization problems is proposed in this paper. the HCOA achieves high-accuracy resolution of singleobjective optimization problems by modelling the behaviour of hermit crab populations. The optimal search and the historical path search are used in the HCOA to balance the depth search and breadth search. The cooperation of the optimal search and historical path search achieves high-precision optimization in high-dimensional spaces. www.nature.com/scientificreports/ Moreover, both the optimal search and the historical path search have linear computation times, which means that the time complexity of the HCOA is O(n).
In the experimental part of this paper, the CEC2017 benchmark functions are used. In a total of 29 test functions, the HCOA scores 23 firsts. Compared with the state-of-the-art BBPSO-based method, BPSO-CM and the HCOA win 20 of 29 tests. All the experimental results demonstrate that the HCOA generates highly accurate and robust results for high-dimensional optimization problems.
However, the HCOA cannot be applied to multiobjective optimization problems and single-objective noncontinuous optimization problems. Furthermore, in the unimodal functions of CEC2017, the performance of the HCOA is inferior to that of BPSO-CM. Therefore, one of the main future research directions is applying the HCOA to multiobjective optimization problems. Additionally, due to the linear time complexity, combining the HCOA with other famous evolutionary strategies, such as SE and PSO, to achieve higher accuracy and greater robustness is another solid option. Table 3. Result analysis of the HCOA, Part 1.

Function Number
Rank of the HCOA Second best algorithm Difference from second best algorithm Convergence graph                                 www.nature.com/scientificreports/